#ifndef _OI_PLSCANNERCORE_VALUEINDATECHART_HPP_
#define _OI_PLSCANNERCORE_VALUEINDATECHART_HPP_

#include "PLScannerCore/OiPLScannerCore.hpp"
#include <QtCharts/QChart>
#include <QtCharts/QChartView>

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API ValueInDateChart : public QtCharts::QChart
        {
            Q_OBJECT

        public:
            ValueInDateChart(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
            virtual ~ValueInDateChart();

        public:
            void setYFormat(const QString);
            void setYRange(double y1, double y2);
            

        public:
            void setValues(const int category, const QList<double> &values, int range);
            void updateTextPos();

        private:
            OI_DISABLE_COPY(ValueInDateChart);
            OI_DECLARE_IMPL(ValueInDateChart);
        };

        class OI_PLSCANNER_CORE_API ValueInDateChartView : public QtCharts::QChartView
        {
            Q_OBJECT

        public slots:
            void setLimit(double upper, double lower);

        public:
            ValueInDateChartView(QWidget *parent = Q_NULLPTR);
            ValueInDateChartView(ValueInDateChart *chart, QWidget *parent = Q_NULLPTR);

        public:
            void resizeEvent(QResizeEvent *event);

        private:
            OI_DISABLE_COPY(ValueInDateChartView);
            OI_DECLARE_IMPL(ValueInDateChartView);
        };
    }
}


#endif
